package com.example.demo.day.config.learn.design.proxy.p3;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class DynamicProxy implements InvocationHandler {

    private Object object;

    DynamicProxy(Object o) {
        this.object = o;
    }

    @Override
    public Object invoke(Object p, Method m, Object[] args) {
        try {
            m.invoke(object, args);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        return null;
    }
}
